﻿using DoNet.Bpmn.Dtos;
using DoNet.Bpmn.IRepostitories;
using DoNet.Bpmn.IServices;
using DoNet.Bpmn.Models;
using DoNet.Core;

namespace DoNet.Bpmn.Services
{
    public class BpmnNodeAssignLevelConfigService : BaseService<BpmnNodeAssignLevelConfig, BpmnNodeAssignLevelConfigOutputDto>, IBpmnNodeAssignLevelConfigService
    {
        /// <summary>
        /// 
        /// </summary>
        private readonly IBpmnNodeAssignLevelConfigRepository repository;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="_baseRepository"></param>
        /// <param name="_repository"></param>
        public BpmnNodeAssignLevelConfigService(IRepository<BpmnNodeAssignLevelConfig> _baseRepository, IBpmnNodeAssignLevelConfigRepository _repository)
        {
            baseRepository = _baseRepository;
            repository = _repository;
        }

        #region 同步方法
        /// <summary>
        /// 同步
        /// </summary>
        /// <param name="bpmnNodeId"></param>
        /// <returns></returns>
        public BpmnNodeAssignLevelConfig GetByBpmnNodeId(long bpmnNodeId)
        {
            return repository.GetByBpmnNodeId(bpmnNodeId);
        }
        #endregion 同步方法

        #region 异步方法
        /// <summary>
        /// 同步
        /// </summary>
        /// <param name="bpmnNodeId"></param>
        /// <returns></returns>
        public async Task<BpmnNodeAssignLevelConfig> GetByBpmnNodeIdAsync(long bpmnNodeId)
        {
            return await repository.GetByBpmnNodeIdAsync(bpmnNodeId);
        }
        #endregion 异步方法
    }
}
